package org.mayanjun.code.dalint.helper;

import java.util.ArrayList;
import java.util.Collection;

/**
 * ReadOnlyArrayList
 *
 * @author mayanjun(08/10/2016)
 */
public class ReadOnlyArrayList <E> extends ArrayList<E> {

	public ReadOnlyArrayList() {
	}

	public ReadOnlyArrayList(Collection<? extends E> c) {
		super(c);
	}

	public ReadOnlyArrayList(int initialCapacity) {
		super(initialCapacity);
	}

	@Override
	public E set(int index, E element) {
		throw new UnsupportedOperationException("Read only list");
	}

	@Override
	public boolean add(E e) {
		throw new UnsupportedOperationException("Read only list");
	}

	@Override
	public void add(int index, E element) {
		throw new UnsupportedOperationException("Read only list");
	}

	@Override
	public E remove(int index) {
		throw new UnsupportedOperationException("Read only list");
	}

	@Override
	public boolean remove(Object o) {
		throw new UnsupportedOperationException("Read only list");
	}

	@Override
	public boolean addAll(Collection<? extends E> c) {
		throw new UnsupportedOperationException("Read only list");
	}

	@Override
	public boolean addAll(int index, Collection<? extends E> c) {
		throw new UnsupportedOperationException("Read only list");
	}

	@Override
	protected void removeRange(int fromIndex, int toIndex) {
		throw new UnsupportedOperationException("Read only list");
	}

	@Override
	public boolean removeAll(Collection<?> c) {
		throw new UnsupportedOperationException("Read only list");
	}
}
